<?php
use \Sy;
use \blog\libs\BHtml;
if (!class_exists('Sy')) {
	exit;
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>链接 - SYBlog</title>
	<?php Sy::view('admin/common/header'); ?>
</head>
<body>
	<?php Sy::view('admin/common/navbar', ['page' => 'link']); ?>
	<div class="page-content">
		<h2 class="title">链接</h2>
		<table class="striped">
			<thead><th>标题</th><th class="action">操作</th></thead>
			<tbody id="list"></tbody>
		</table>
		<ul id="page" class="pagination"></ul>
	</div>
	<div class="fixed-action-btn">
		<button id="link_add" class="waves-effect waves-circle waves-light btn-floating btn-large red"><i class="mdi-add"></i></button>
	</div>
	<div id="link_form" class="modal">
		<div class="modal-content">
			<h4 id="link_form_title"></h4>
			<input type="hidden" id="link_id"/>
			<div class="row">
				<div class="input-field col s12">
					<input id="title" type="text"/>
					<label for="title">标题</label>
				</div>
				<div class="input-field col s12">
					<input id="rel" type="text"/>
					<label for="rel">标签</label>
				</div>
				<div class="input-field col s12">
					<input id="url" type="text"/>
					<label for="url">URL</label>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<a id="link_submit" class="modal-action modal-close waves-effect btn-flat">保存</a>
			<a class="modal-action modal-close waves-effect btn-flat">取消</a>
		</div>
	</div>
	<script>
	window.sy = {
		"url": {
			"list": "<?=Sy::createUrl('admin/link', 'json')?>",
			"ajaxAdd": "<?=Sy::createUrl('admin/ajaxLinkAdd', 'json')?>",
			"ajaxEdit": "<?=Sy::createUrl('admin/ajaxLinkEdit', 'json')?>",
			"ajaxDel": "<?=Sy::createUrl('admin/ajaxLinkDel', 'json')?>",
		},
		"page": "Link"
	};
	</script>
	<?php Sy::view('admin/common/footer'); ?>
</body>
</html>